<div class="slide-dialog-header">
    <h2>{{title}}</h2>
    <div class="slide-dialog-toolbar">
        <ul>
            <li>
                <span class="ui-btn slide-dialog-close" ng-click="close(false)"><i class="fa fa-remove"></i></span>
            </li>
        </ul>
    </div>
</div>
<div class="slide-dialog-body">
    <div class="data-panel">
        <form name="form" novalidate="novalidate" ng-submit="submit(form.$valid);">
            <div class="data-panel-body">
                <div class="data-form">
                    <dl>
                        <dt><span class="x-star">*</span>规则名称：</dt>
                        <dd>
                            <input type="text" name="name" ng-model="data.ruleName" class="x-ipt" placeholder="请输入名称" required />
                            <div class="x-error" ng-if="interacted(form.name)" ng-messages="form.name.$error">
                                <span ng-message="required">规则名称不能为空</span>
                            </div>
                        </dd>
                    </dl>
                    <dl>
                        <dt><span class="x-star">*</span>规则描述：</dt>
                        <dd>
                            <textarea name="desc" ng-model="data.ruleDesc" class="x-ipt" rows="8" placeholder="请输入规则描述" required>
                            </textarea>
                            <div class="x-error" ng-if="interacted(form.desc)" ng-messages="form.desc.$error">
                                <span ng-message="required">规则描述不能为空</span>
                            </div>
                        </dd>
                    </dl>
                    <!-- <dl>
                        <dt><span class="x-star">*</span>自定义方法体：</dt>
                        <dd>
                            <textarea name="code" ng-model="data.code" class="x-ipt" rows="8" placeholder="请输入代码" required>
                            </textarea>
                            <div class="x-error" ng-if="interacted(form.code)" ng-messages="form.code.$error">
                                <span ng-message="required">方法体不能为空</span>
                            </div>
                        </dd>
                    </dl> -->
                    <dl>
                        <dt><span class="x-star">*</span>自定义方法体：</dt>
                        <dd>
                            <textarea ui-codemirror ui-codemirror-opts="codeOptions" ui-refresh="timer" ng-model="data.code" class="x-ipt" rows="8" placeholder="请输入代码" required>
                            </textarea>
                        </dd>
                    </dl>
                    <dl>
                        <dt><span class="x-star">*</span>方法体参数：</dt>
                        <dd>
                            <div class="data-map">
                                <dl ng-repeat="json in jsonArray() track by $index">
                                    <dd>
                                        <input type="text" class="x-ipt" ng-model="json[getKey(1)]" placeholder="请输入参数名" required />
                                        <span class="data-map-tools">
                                            <span class="ico-btn fa fa-minus-square" ng-click="removeJson($index)"></span>
                                            <span class="ico-btns" ng-if="$index != jsonArray().length - 1">
                                                <span class="ico-btn fa fa-caret-up" ng-if="$index != 0" ng-click="movePrev($index)"></span>
                                                <span class="ico-btn fa fa-caret-down" ng-click="moveNext($index)"></span>
                                            </span>
                                            <span class="ico-btn fa fa-plus-square" ng-if="$index == jsonArray().length - 1" ng-click="addJson()"></span>
                                        </span>
                                    </dd>
                                </dl>
                            </div>
                        </dd>
                    </dl>
                </div>
            </div>
            <div class="data-panel-footer">
                <div class="data-tools">
                    <button class="dialog-button cancel-button" type="button" ng-click="close(false)">取消</button>
                    <button class="dialog-button" type="submit" ng-disabled="formDisabled">提交</button>
                </div>
            </div>
        </form>
    </div>
</div>